package com.banyechan.lingo_words.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 业务异常枚举
 *
 * https://47.97.62.69/confluence/pages/viewpage.action?pageId=65794
 *
 * @author Jax
 * 请逐步迁移到各自的微服务， 尽量不要使用占位符
 */
@Getter
//@Deprecated
@AllArgsConstructor
public enum BusinessExceptionEnum {

    /**
     * 网关/全局
     */
    UNKNOWN_DEVICE(899998, "您已在其他设备登录，请重新登录"),
    SQUEEZED_OUT_TOKEN_KEY(899999, "被其他登录人踢出"),
    COMMON_ILLEGAL_REQUEST(900000, "非法请求"),
    COMMON_TOKEN_INVALID_OR_EXPIRED(900001, "认证失效或过期"),
    COMMON_METHOD_TYPR_NOT_SUPPORTED(900002, "http method不支持"),
    COMMON_PARAM_TYPR_NOT_SUPPORTED(900003, "请求参数不支持"),
    COMMON__FEIGN_CLIENT_UNAVAILABLE(900005, "目标客户端不可用: "),

    //通用数据不存在 %s占位符，可以传参
    COMMON_DATA_NOT_EXISTS(900004, "%s数据不存在"),
    COMMOM_IDCARD_ERROR(900005, "身份证信息有误"),
    COMMOM_IDCARD_NO_MATCH(900006, "个人信息与身份证不符"),
    OCR_SCAN_FAILED(900007, "请按要求上传正确的身份证正反面照片"),
    COMMON_IDCARD_OTHER_ERROR(900009, "%s"),
    DO_NOT_CLICK_REPEATEDLY(900010, "请勿重复操作"),
    SYSTEM_ERROR(900011, "系统错误"),
    DATA_ACCESS_ERROR(900012, "数据处理异常"),

    SMS_TEMPLATE_NULL(910000, "短信模板为空"),
    SMS_TYPE_NOT_FOUND(910001, "发送类型未找到"),
    SMS_SEND_ERROR(910002, "短信发送异常"),
    SMS_SEND_MOBILE_ERROR(910003, "手机号格式不正确"),
    SMS_VERIFY_CODE_NO_MATCH(910004, "验证码不正确"),


    EXCEL_PARSING_NULL(110095, "excel解析内容为空，请上传有内容的excel"),
    FILENAME_SUFFIX_ERROR(110096, "请上传xls或xlsx文件!"),
    EXCEL_PARSING_TITLE_NAME(110097, "excel解析表头错误，缺少必须表头【%s】"),

    OSS_UPLOAD_ERROR(920000, "文件上传失败"),
    OSS_DOWNLOAD_ERROR(920001, "文件下载失败");


    /**
     * code为业务异常code。长度6位，前两位代表模块，后四位为异常code
     * 具体参考<lINK>https://47.97.62.69/confluence/pages/viewpage.action?pageId=65794
     */
    private final Integer code;
    /**
     * 异常信息
     */
    private final String msg;

}
